import request from '@/utils/request';

/**
 * 管理员主页处理
 */
export async function adminIndexInit() {
  const res = await request.get('/admin/index/init',);
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


export async function counsellorIndexInit() {
  const res = await request.get('/counsellor/index/init', {timeout: 300000});
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

/**
 * 学生主页处理
 * @returns {Promise<any>}
 */
export async function studentIndexInit() {
  const res = await request.get('/admin/index/init',);
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}


/**
 * 用人单位主页处理
 * @returns {Promise<any>}
 */
export async function companyIndexInit() {
  const res = await request.get('/admin/index/init',);
  if (res.data.code === 200) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}
